import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {


        Scanner in = new Scanner(System.in);
        int T = in.nextInt();
        while(T-->0){
            int n = in.nextInt();
            boolean[] dp = new boolean[n + 1];

            for(int i = n; i >= 1; i--){
                boolean canWin = false;
                for(int next = i+1; next <= i+3 && next<=n; next++){
                    if(!dp[next]){
                        canWin = true;
                        break;
                    }
                }
                dp[i] = canWin;
            }
            List<Integer> list = new ArrayList<>();
            for(int k = 1; k <= n; k++){
                if(k+1<=n){
                    if(!dp[k + 1] || (k + 2 <= n && !dp[k + 2]) || (k + 3 <= n && !dp[k + 3])){
                        list.add(k);
                    }
                }
            }
            if(list.isEmpty()){
                System.out.println(-1);
            }else{
                String ans = list.stream().map(String::valueOf).collect(Collectors.joining(" "));
                System.out.println(ans);
            }
        }
    }
}